package com.linwancun.lwcyback.service;

import com.linwancun.lwcyback.mapper.DoctorMapper;
import com.linwancun.lwcyback.model.Doctor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DoctorServiceImp implements DoctorService {

    @Resource
    private DoctorMapper doctorMapper;


    @Override
    public void insert(Doctor object) {
        doctorMapper.insert(object);
    }

    @Override
    public void save(Doctor object) {
        doctorMapper.updateByPrimaryKey(object);
    }

    @Override
    public List<Doctor> getAll() {
        return doctorMapper.list(new Doctor());
    }

    @Override
    public Doctor find(Doctor object) {
        return doctorMapper.find(object);
    }

    @Override
    public void delete(Doctor object) {
        doctorMapper.deleteByPrimaryKey(object.getDoctorid());
    }

    @Override
    public List<Doctor> getList(Doctor object) {
        return doctorMapper.list(object);
    }

}
